load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "workingcopy",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "dependencies_override": {"dependencies": {
            "sapling-configmodel": {"features": ["convert-path"]},
            "sapling-edenfs-client": {"optional": True},
        }},
        "features": {"eden": ["sapling-edenfs-client"]},
        "lib": {"name": "workingcopy"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-workingcopy",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    features = [
        "eden",
    ],
    test_deps = [
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:tempfile",
        "//eden/scm/lib/blob:blob",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:bitflags",
        "fbsource//third-party/rust:crossbeam",
        "fbsource//third-party/rust:fs-err",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:parking_lot",
        "fbsource//third-party/rust:regex",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tracing",
        "fbsource//third-party/rust:whoami",
        "//eden/scm/lib/async-runtime:async-runtime",
        "//eden/scm/lib/config/model:configmodel",
        "//eden/scm/lib/context:context",
        "//eden/scm/lib/edenfs-client:edenfs-client",
        "//eden/scm/lib/gitcompat:gitcompat",
        "//eden/scm/lib/hgtime:hgtime",
        "//eden/scm/lib/identity:identity",
        "//eden/scm/lib/io/term/logger:termlogger",
        "//eden/scm/lib/journal:journal",
        "//eden/scm/lib/manifest:manifest",
        "//eden/scm/lib/manifest-tree:manifest-tree",
        "//eden/scm/lib/pathmatcher:pathmatcher",
        "//eden/scm/lib/progress/model:progress-model",
        "//eden/scm/lib/repolock:repolock",
        "//eden/scm/lib/sparse:sparse",
        "//eden/scm/lib/status:status",
        "//eden/scm/lib/storemodel:storemodel",
        "//eden/scm/lib/submodule:submodule",
        "//eden/scm/lib/treestate:treestate",
        "//eden/scm/lib/types:types",
        "//eden/scm/lib/util:util",
        "//eden/scm/lib/util/hgplain:hgplain",
        "//eden/scm/lib/vfs:vfs",
        "//eden/scm/lib/workingcopy/repostate:repostate",
        "//watchman/rust/watchman_client:watchman_client",
    ],
)
